package fun.zerone.service.user.dao.account;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import fun.zerone.service.user.entity.account.User;
import fun.zerone.service.user.mapper.account.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * Created by XQL on 2021/4/13.
 */
@Component
public class UserDao {

    @Autowired
    private UserMapper userMapper;

    public List<User> findById(Integer id) {
        LambdaQueryWrapper<User> wrapper = new LambdaQueryWrapper<>();
        wrapper.select(User::getUid, User::getUname, User::getUnick);
        wrapper.eq(User::getUid, id);
        return userMapper.selectList(wrapper);
    }

}
